package com.pro.apiService;

import com.pro.base.BaseService;
import com.pro.parameter.ReqInfoDto;
import com.pro.service.RegisterServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * Copyright C 四川众鹏科技有限公司
 * All right reserved.  RegisterSerivces
 * 创建者：aoneng 2022/9/16
 * Description:
 * 备注   :
 * version:  V1.0
 * <author> - <version > - <time>  -    <desc>
 *
 * @author 敖能         V1.0       2022/9/16    完成基本功能
 */
@RestController
@RequestMapping("/aCloud")
public class RegisterApis extends BaseService {
    @Autowired
    private  RegisterServices registerServices;
    /**
     * 服务接口注册
     *
     * @return
     */
    @PostMapping("/register")
    public ResponseEntity register(@RequestBody ReqInfoDto reqInfo) {
       Boolean res= registerServices.put(reqInfo);
        // 将该服务地址 存放到 Map集合中
        return setResult(res);
    }
    /**
     * 服务接口续约
     *
     * @return
     */
    @PostMapping("/renewal")
    public ResponseEntity renewal(@RequestBody ReqInfoDto reqInfo) {
       Boolean res= registerServices.renewal(reqInfo);
        // 将该服务地址 存放到 Map集合中
        return setResult(res);
    }

    @GetMapping("/test")
    public String test() {
       return  "1";
    }
}
